package ${packagepath};

import org.apache.log4j.Logger;
import com.action.BaseAction;
import java.util.ArrayList;
import java.util.List;
import com.util.PaginatedList;
import com.pub.exception.ExceptionUtils;
import com.bean.${beanname};
import com.interfaces.service.I${beanname}Service;
import com.interfaces.service.BaseService;
/**
 * 
 * <p>功能描述:${description}</p>
 * @author  <a href="mailto: zhuyoulong@gmail.com">zhuyoulong</a>
 * @create_date 2008-11-4
 * @version $ Revision: 1.0
 */
 @SuppressWarnings("serial")
public class ${classname} extends BaseAction {
	private Logger logger = Logger.getLogger(${classname}.class);
	/**
	 * 分页list
	 */
    private PaginatedList<${beanname}> ${listname};
    /**
	 * bean对象
	 */
    private ${beanname} ${beanobject};
    /**
	 * checkbox 多条记录删除id数组
	 */
    private List ids;
    
    /**
	 * service接口注入：
	 */
    private I${beanname}Service I${beanname};
    /**
    * 通用SQL接口
    */
    private BaseService IBaseService;
    /**
	 * 
	 * <p>功能描述：列表方法</p>
	 * @return
	 * @author:yourname
	 * @update:[日期YYYY-MM-DD][更改人姓名][变更描述]
	 */
    public String list${beanname}(){
        /**
        ${beanobject} = new ${beanname}();
		${beanobject}List = I${beanname}.get${beanname}List(${beanobject}, pageNo, pageSize);
		this.page(${beanobject}List);
		*/
        return SUCCESS;
    }
    
    /**
	 * 
	 * <p>功能描述：跳转到添加页面</p>
	 * @return
	 * @author:yourname
	 * @update:[日期YYYY-MM-DD][更改人姓名][变更描述]
	 */
    public String toInsert${beanname}(){
    	//实现代码
        return SUCCESS;
    }
    
    /**
	 * 
	 * <p>功能描述：添加方法</p>
	 * @return
	 * @author:yourname
	 * @update:[日期YYYY-MM-DD][更改人姓名][变更描述]
	 */
    public String insert${beanname}(){
	    /**
	    	try {
	
				I${beanname}.doinsert${beanname}(${beanobject});
			} catch (Exception e) {
				logger.error(e);
				message="添加异常，请联系管理员";
				return ERROR;
			}
		*/
        return SUCCESS;
    }
	
	/**
	 * 
	 * <p>功能描述：跳转到修改页面</p>
	 * @return
	 * @author:yourname
	 * @update:[日期YYYY-MM-DD][更改人姓名][变更描述]
	 */
    public String toUpdate${beanname}(){
	    /**
    	    ${beanobject} = I${beanname}.get${beanname}(${beanobject});
        */
        return SUCCESS;
    }

    /**
	 * 
	 * <p>功能描述：修改方法</p>
	 * @return
	 * @author:yourname
	 * @update:[日期YYYY-MM-DD][更改人姓名][变更描述]
	 */
    public String update${beanname}(){
		/**
		try {
			I${beanname}.doupdate${beanname}(${beanobject});
		} catch (Exception e) {
			logger.error(e);
			message="修改异常，请联系管理员";
			return ERROR;
		}
		*/
        return SUCCESS;
    }

	/**
	 * 
	 * <p>功能描述：搜索方法</p>
	 * @return
	 * @author:yourname
	 * @update:[日期YYYY-MM-DD][更改人姓名][变更描述]
	 */
    public String search${beanname}(){
        /**
        if (${beanobject} == null) {
			${beanobject} = new ${beanname}();
		}

		String title = ${beanobject}.getTitle().trim();

		${beanobject}.setTitle(StringUtils.ISO2UTF(title));
		${beanobject}List = I${beanname}.get${beanname}List(${beanobject}, pageNo,
				pageSize);

		this.page(${beanobject}List);
		*/
        return SUCCESS;
    }

	/**
	 * 
	 * <p>功能描述：删除方法</p>
	 * @return
	 * @author:yourname
	 * @update:[日期YYYY-MM-DD][更改人姓名][变更描述]
	 */
    public String delete${beanname}(){
    	/**
		try {
			//-----------删除图片开始--(如果没有删除图片把下面删除)---------
			List idsarray = new ArrayList();
			for (int i = 0; i < ids.size(); i++) {
				String id = ids.get(i).toString();
				String[] array = id.split("==");
				idsarray.add(array[0]);
				if(array.length==2){
					String pic = array[1];//广告图片
					this.deleteFile("", pic);
				}
			}
			//-----------删除图片结束------------
			
			I${beanname}.dodelete${beanname}(ids);
		} catch (Exception e) {
			logger.error(e);
			message="删除异常，请联系管理员";
			return ERROR;
		}
		*/
        return SUCCESS;
    }

   
    
    public PaginatedList<${beanname}> get${beanname}List() {
		return ${listname};
	}
	public void set${beanname}List(PaginatedList<${beanname}> ${beanobject}List) {
		this.${beanobject}List = ${beanobject}List;
	}

    
    

    public ${beanname} get${beanname}() {
        return ${beanobject};
    }

    public void set${beanname}(${beanname} ${beanobject}) {
        this.${beanobject} = ${beanobject};
    }

    public List getIds() {
        return ids;
    }

    public void setIds(List ids) {
        this.ids = ids;
    }
    
    public I${beanname}Service getI${beanname}() {
		return I${beanname};
	}

	public void setI${beanname}(I${beanname}Service ${beanobject}) {
		I${beanname} = ${beanobject};
	}
	
	public BaseService getIBaseService() {
		return IBaseService;
	}

	public void setIBaseService(BaseService baseService) {
		IBaseService = baseService;
	}
}